#include "../inc/Signal.hxx"
#include "../inc/Utils.hxx"
#include <iostream>
#include <complex>

Signal::Signal(int carrierFrequency, double pulseLength, double amplitude) : carrierFrequency(carrierFrequency), pulseLength(pulseLength) {}

Signal::Signal(const Signal& signal) : carrierFrequency(signal.carrierFrequency), pulseLength(signal.pulseLength) {}

void Signal::generateSinus() { 
    int samplesCount = carrierFrequency*pulseLength;
    vector<double> linspace = Utils::linspace(0.0, pulseLength);
    vector<double>::iterator iterator;
    for(iterator = linspace.begin(); iterator != linspace.end(); iterator++) {
        double step = *iterator;
        double real = amplitude * cos(2 * M_PI * carrierFrequency * step);
        double imag = amplitude * sin(2 * M_PI * carrierFrequency * step);
        push_back(std::complex<double>(real, imag));
    }
}

double& Signal::getAzimuth() {
    return this->azimuth;
}

void Signal::setAzimuth(double azimuth) {
    this->azimuth = azimuth;
}


